# Contributor: mio <miyopan@e.email>
# Maintainer: mio <miyopan@e.email>
pkgname=rime-plum
pkgver=0_git20230207
pkgrel=0
_gitrev=6f502ff6fa87789847fa18200415318e705bffa4
pkgdesc="Rime configuration manager and input schemas"
url="https://github.com/rime/plum"
license="LGPL-3.0-or-later"
arch="noarch"
depends="
	librime
	opencc
	"
makedepends="
	bash
	git
	librime-tools
	"
subpackages="
	$pkgname-data
	$pkgname-tools
	"
source="$pkgname-$_gitrev.tar.gz::https://github.com/rime/plum/archive/$_gitrev.tar.gz"
options="!check" # No tests
builddir="$srcdir"/plum-"$_gitrev"

build() {
	make preset-bin
}

package() {
	depends="
		$pkgname-data=$pkgver-r$pkgrel
		$pkgname-tools=$pkgver-r$pkgrel
		"
	DESTDIR="$pkgdir" make install
	install -Dm 755 "$builddir"/rime-install "$pkgdir"/usr/bin/rime-install
}

data() {
	pkgdesc="$pkgdesc (input schemas)"
	amove usr/share/rime-data
}

tools() {
	pkgdesc="$pkgdesc (configuration tools)"
	depends="bash git"
	amove usr/bin/rime-install
}

sha512sums="
682406ec3ea1f4f447f3f1a5283d820b45c909a47cb87c7be87b4c26d5524571210990c0942db02bb3ba83fc6cda36d77dad7a3ce9787a1f6c584c18f9712caf  rime-plum-6f502ff6fa87789847fa18200415318e705bffa4.tar.gz
"
